-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Multi-axis Shapes #7666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Multi-axis Shapes #7666
Conversation
Co-authored-by: Alex Johnson <alex@plot.ly>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@alexshoe This is looking really good. 🎉 I left some minor comments on the implementation (mostly style and readability) and also noticed some issues with the Jasmine tests. Could you do a pass through all the Jasmine tests and make sure they make sense, are testing the right things, etc. I also realized there's a pretty good chance that |
|
@emilykl Thanks for the comments! I tested Meanwhile, I also modified the code to display labels for non-path shapes since it previously didn't work well with multi-axis references. Also added labels to the image test to confirm that it works. |
|
@alexshoe Thanks to @camdecoster 's work in #7577 , we now have the Good news that raw values work as expected! |
| beforeEach(function() { gd = createGraphDiv(); }); | ||
| afterEach(destroyGraphDiv); | ||
|
|
||
| function getShape(index) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| function getShape(index) { | |
| function getShapesWithIndex(index) { |
| expect(lineBBox.left).toBeCloseTo(lineExpectedLeft); | ||
| expect(lineBBox.right).toBeCloseTo(lineExpectedRight); | ||
| var lineBBox = getBoundingBox(0); | ||
| expect(lineBBox.left).toBeCloseTo(xa.l2p(1) + xa._offset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only issue with this testing approach is the question of whether xa._offset itself might ever have an incorrect value due to the presence of a multi-axis shape. Do you know where/how xa._offset is calculated?
If you think that's not possible, this is OK.
| expect(gd._fullLayout.xaxis2.range[0]).toBeLessThan(1); | ||
| expect(gd._fullLayout.xaxis2.range[1]).toBeGreaterThan(5); | ||
| expect(gd._fullLayout.yaxis2.range[0]).toBeLessThan(1); | ||
| expect(gd._fullLayout.yaxis2.range[1]).toBeGreaterThan(5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably use .toBeCloseTo() here as well
Description:
Extends
xrefandyrefto accept arrays, allowing shapes to span multiple subplots with each vertex anchored to a different axis. See #7151 for more information.Example:
Progress:
xrefandyrefto allow array values